import flash.events.ContextMenuEvent;
import flash.net.URLRequest;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuItem;

public function buildRightClickMenu():void
{
	var cm:ContextMenu = new ContextMenu();
	cm.addEventListener(ContextMenuEvent.MENU_SELECT, onContextMenuSelect);
	cm.hideBuiltInItems();
	
	var versionItem:ContextMenuItem = new ContextMenuItem("Charts by oChart [Version " + VERSION + "]" );
	versionItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onVersionSelect);
	cm.customItems.push( versionItem );
	
	this.contextMenu = cm;
}

private function onContextMenuSelect(event:ContextMenuEvent):void
{
	
}

private function onVersionSelect(event:ContextMenuEvent):void
{
	var url:String = "http://code.google.com/p/ochart/";
	var urlRequest:URLRequest = new URLRequest(url);
	flash.net.navigateToURL(urlRequest, '_blank');
}